package com.ruoyi.question.mapper;
import java.util.List;

import com.ruoyi.question.domain.ExpressQuestion;
import com.ruoyi.question.domain.ExpressQuestionKind;
import org.apache.ibatis.annotations.*;

/**
 * 公告Mapper接口
 * 
 * @author ruoyi
 * @date 2024-08-22
 */
public interface QuestionMapper
{
    @Select("select * from express_question_kind order by sort asc")
    List<ExpressQuestionKind> questionKindList(ExpressQuestionKind questionKind);
    @Select("select * from express_question q join express_question_kind k on q.question_type=k.question_type order by q.sort asc")
    List<ExpressQuestion> questionList(ExpressQuestion question);
    @Insert("insert into express_question_kind (question_type,question_english_type,client,sort,status,create_date,quote) values (#{questionType},#{questionEnglishType},#{client},#{sort},#{status},#{createDate},#{quote})")
    int questionKindAdd(ExpressQuestionKind questionKind);
    @Update("update express_question_kind set question_type=#{questionType},question_english_type=#{questionEnglishType},client=#{client},sort=#{sort},last_date=#{lastDate} where id=#{id}")
    int questionKindUpdate(ExpressQuestionKind questionKind);
    @Delete("delete from express_question_kind where id=#{id}")
    int deleteQuestionKind(Long id);
    @Update("update express_question_kind set status=2 where id=#{id}")
    int updatKindFalse(Long id);
    @Update("update express_question_kind set status=1 where id=#{id}")
    int updateKindTrue(Long id);
    @Update("update express_question set status=2 where id=#{id}")
    int updateFalse(Long id);
    @Update("update express_question set status=1 where id=#{id}")
    int updateTrue(Long id);
    @Delete("delete from express_question where id=#{id}")
    int deleteQuestion(Long id);
    @Select("select * from express_question_kind")
    List<ExpressQuestionKind> questionKind(ExpressQuestionKind kind);
    @Insert("insert into express_question (language,question_type,client,name,sort,context,status,create_date) values (#{language},#{questionType},#{client},#{name},#{sort},#{context},#{status},#{createDate})")
    int questionAdd(ExpressQuestion question);
    @Select("select * from express_question_kind where id=#{id}")
    ExpressQuestionKind questionKindListById(Long id);
    @Update("update express_question set language=#{language},question_type=#{questionType},client=#{client},sort=#{sort},name=#{name},context=#{context},create_date=#{createDate},status=#{status},last_date=#{lastDate} where id=#{id}")
    int questionUpdate(ExpressQuestion question);

}
